package com.firstcloud.controller;

import com.firstcloud.pojo.CommonResult;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

import javax.annotation.Resource;

/*
 *@author HuJun
 */
@RestController
public class OrderController {

    @Resource
    private RestTemplate restTemplate;
    private final String URL="http://localhost:8001";

    @GetMapping("/consumer/payment/get/{id}")
    public CommonResult getPaymentById(@PathVariable("id")Integer id){
        return restTemplate.getForObject(URL+"/payment/get/"+id, CommonResult.class,id);
    }

}
